import request from '@/utils/request';

export function findProviderList(params:any){
  return request('/xwyl/serviceProvider/findProviderList', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function addProvider(params:any){
  return request('/xwyl/serviceProvider/addProvider', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function editProvider(params:any){
  return request('/xwyl/serviceProvider/editProvider', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function findOrderSettlementList(params:any){
  return request('/xwyl/orderSettlement/findOrderSettlementList', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function settleBatch(params:any){
  return request('/xwyl/orderSettlement/settleBatch', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function findSettlementBatch(params:any){
  return request('/xwyl/orderSettlement/findSettlementBatch', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function addServiceDealer(params:any){
  return request('/xwyl/serviceProvider/addServiceDealer', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}



export function findServiceDealer(params:any){
  return request('/xwyl/serviceProvider/findServiceDealer', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function editSettlementDetail(params:any){
  return request('/xwyl/orderSettlement/editSettlementDetail', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}


export async function pDeleteById(params: any) {
  var data =  request('/xwyl/serviceProvider/deleteById', {
    params,
  });
  return data;
}

export async function findDetailBySettlementId(params: any) {
  var data =  request('/xwyl/orderSettlement/findDetailBySettlementId', {
    params,
  });
  return data;
}


export async function unboundDealerAndServiceProvider(params: any) {
  var data =  request('/xwyl/serviceProvider/unboundDealerAndServiceProvider', {
    params,
  });
  return data;
}


export function findSettlementStatistic(params:any){
  return request('/xwyl/orderSettlement/findSettlementStatistic', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function exportSettlementStatistic(params:any){
  return request('/xwyl/orderSettlement/exportSettlementStatistic', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}

export function setStatus(params:any){
  return request('/xwyl/orderSettlement/setStatus', {
    method: 'POST',
    headers:{
      'Content-Type': 'application/json',
      'authorization':`${sessionStorage.getItem('token')}`
    },
    data: {
      ...params,
      method: 'post',
    },
  });
}